LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/sparse/src)
LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/sparse/impl)
LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/sparse/eti)
LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/sparse/eti)
LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/sparse/tpls)

#Add tpls source file
LIST(APPEND SOURCES sparse/tpls/KokkosKernels_tpl_handles.cpp)


##################
#                #
# ETI generation #
#                #
##################

#Build up a list of DECL, AVAIL, and INST macros
#that should be instantiated based on input options
#Generate @X@ variables in the template X.hpp.in and X.cpp.in
#files containing the list of all needed macros
KOKKOSKERNELS_GENERATE_ETI(Sparse_sptrsv_solve sptrsv_solve
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spmv_struct spmv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spmv_mv_struct spmv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spmv_bsrmatrix spmv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spmv_mv_bsrmatrix spmv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spmv spmv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spmv_mv spmv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spgemm_symbolic spgemm_symbolic
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spgemm_numeric spgemm_numeric
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spgemm_noreuse spgemm_noreuse
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_bspgemm_numeric bspgemm_numeric
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spgemm_jacobi spgemm_jacobi
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

# NOTE: SpAdd symbolic doesn't use scalars directly,
# but it needs the type to use handles.
KOKKOSKERNELS_GENERATE_ETI(Sparse_spadd_symbolic spadd_symbolic
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spadd_numeric spadd_numeric
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spiluk_symbolic spiluk_symbolic
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_spiluk_numeric spiluk_numeric
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_par_ilut_symbolic par_ilut_symbolic
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_par_ilut_numeric par_ilut_numeric
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_gmres gmres
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_sptrsv_symbolic sptrsv_symbolic
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_trsv trsv
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_gauss_seidel_symbolic gauss_seidel_symbolic
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_gauss_seidel_numeric gauss_seidel_numeric
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)

KOKKOSKERNELS_GENERATE_ETI(Sparse_gauss_seidel_apply gauss_seidel_apply
  COMPONENTS  sparse
  HEADER_LIST ETI_HEADERS
  SOURCE_LIST SOURCES
  TYPE_LISTS  FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
)
